package com.xiaoxin.experience.util;

import org.springframework.util.Assert;

/**
 * @author xiaoxin
 */
public class ParamUtil {

    private ParamUtil() {}

    public static int between(int left, int right, int value)
    {
        Assert.isTrue(left <= right,"left can not greater than right");
        if (value < left)
        {
            return left;
        }
        return Math.min(right,value);
    }
}
